package com.shop.storage.service.impl;

import java.util.List;

import com.shop.storage.vo.response.ForewarningResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.shop.storage.mapper.WmsForewarningMapper;
import com.shop.storage.domain.WmsForewarning;
import com.shop.storage.service.IWmsForewarningService;

/**
 * 预警Service业务层处理
 * 
 * @author shop
 * @date 2024-06-24
 */
@Service
public class WmsForewarningServiceImpl implements IWmsForewarningService 
{
    @Autowired
    private WmsForewarningMapper wmsForewarningMapper;

    /**
     * 查询预警
     * 
     * @param id 预警主键
     * @return 预警
     */
    @Override
    public WmsForewarning selectWmsForewarningById(Long id)
    {
        return wmsForewarningMapper.selectWmsForewarningById(id);
    }

    /**
     * 查询预警列表
     * 
     * @param wmsForewarning 预警
     * @return 预警
     */
    @Override
    public List<ForewarningResponse> selectWmsForewarningList(WmsForewarning wmsForewarning)
    {
        return wmsForewarningMapper.selectWmsForewarningList(wmsForewarning);
    }

    /**
     * 新增预警
     * 
     * @param wmsForewarning 预警
     * @return 结果
     */
    @Override
    public int insertWmsForewarning(WmsForewarning wmsForewarning)
    {
        return wmsForewarningMapper.insertWmsForewarning(wmsForewarning);
    }

    /**
     * 修改预警
     * 
     * @param wmsForewarning 预警
     * @return 结果
     */
    @Override
    public int updateWmsForewarning(WmsForewarning wmsForewarning)
    {
        return wmsForewarningMapper.updateWmsForewarning(wmsForewarning);
    }

    /**
     * 批量删除预警
     * 
     * @param ids 需要删除的预警主键
     * @return 结果
     */
    @Override
    public int deleteWmsForewarningByIds(Long[] ids)
    {
        return wmsForewarningMapper.deleteWmsForewarningByIds(ids);
    }

    /**
     * 删除预警信息
     * 
     * @param id 预警主键
     * @return 结果
     */
    @Override
    public int deleteWmsForewarningById(Long id)
    {
        return wmsForewarningMapper.deleteWmsForewarningById(id);
    }

    /**
     *
     * 批量修改
     * @param wmsForewarnings
     */
    @Override
    public void updateWmsForewarningList(List<WmsForewarning> wmsForewarnings) {
        wmsForewarningMapper.updateWmsForewarningList(wmsForewarnings);
    }

    /**
     * 根据仓库id修改
     * @param id
     */
    @Override
    public void updateWmsForewarningSkuId(Long  id,Long status) {
        int i = wmsForewarningMapper.updateWmsForewarningSkuId(id, status);
        System.out.println(i);
    }
}
